\(\int \frac {\cot ^4(x)}{a+a \csc (x)} \, dx\) [8]

   Optimal result
   Rubi [A] (verified)
   Mathematica [B] (verified)
   Maple [A] (verified)
   Fricas [B] (verification not implemented)
   Sympy [F]
   Maxima [B] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 13, antiderivative size = 31 \[ \int \frac {\cot ^4(x)}{a+a \csc (x)} \, dx=\frac {x}{a}+\frac {\text {arctanh}(\cos (x))}{2 a}+\frac {\cot (x) (2-\csc (x))}{2 a} \]

[Out]

x/a+1/2*arctanh(cos(x))/a+1/2*cot(x)*(2-csc(x))/a

Rubi [A] (verified)

Time = 0.08 (sec) , antiderivative size = 31, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.231, Rules used = {3973, 3966, 3855} \[ \int \frac {\cot ^4(x)}{a+a \csc (x)} \, dx=\frac {\text {arctanh}(\cos (x))}{2 a}+\frac {x}{a}+\frac {\cot (x) (2-\csc (x))}{2 a} \]

[In]

Int[Cot[x]^4/(a + a*Csc[x]),x]

[Out]

x/a + ArcTanh[Cos[x]]/(2*a) + (Cot[x]*(2 - Csc[x]))/(2*a)

Rule 3855

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rule 3966

Int[(cot[(c_.) + (d_.)*(x_)]*(e_.))^(m_)*(csc[(c_.) + (d_.)*(x_)]*(b_.) + (a_)), x_Symbol] :> Simp[(-e)*(e*Cot
[c + d*x])^(m - 1)*((a*m + b*(m - 1)*Csc[c + d*x])/(d*m*(m - 1))), x] - Dist[e^2/m, Int[(e*Cot[c + d*x])^(m -
2)*(a*m + b*(m - 1)*Csc[c + d*x]), x], x] /; FreeQ[{a, b, c, d, e}, x] && GtQ[m, 1]

Rule 3973

Int[(cot[(c_.) + (d_.)*(x_)]*(e_.))^(m_)*(csc[(c_.) + (d_.)*(x_)]*(b_.) + (a_))^(n_), x_Symbol] :> Dist[a^(2*n
)/e^(2*n), Int[(e*Cot[c + d*x])^(m + 2*n)/(-a + b*Csc[c + d*x])^n, x], x] /; FreeQ[{a, b, c, d, e, m}, x] && E
qQ[a^2 - b^2, 0] && ILtQ[n, 0]

Rubi steps \begin{align*} \text {integral}& = \frac {\int \cot ^2(x) (-a+a \csc (x)) \, dx}{a^2} \\ & = \frac {\cot (x) (2-\csc (x))}{2 a}-\frac {\int (-2 a+a \csc (x)) \, dx}{2 a^2} \\ & = \frac {x}{a}+\frac {\cot (x) (2-\csc (x))}{2 a}-\frac {\int \csc (x) \, dx}{2 a} \\ & = \frac {x}{a}+\frac {\text {arctanh}(\cos (x))}{2 a}+\frac {\cot (x) (2-\csc (x))}{2 a} \\ \end{align*}

Mathematica [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(90\) vs. \(2(31)=62\).

Time = 0.16 (sec) , antiderivative size = 90, normalized size of antiderivative = 2.90 \[ \int \frac {\cot ^4(x)}{a+a \csc (x)} \, dx=\frac {x}{a}+\frac {\cot \left (\frac {x}{2}\right )}{2 a}-\frac {\csc ^2\left (\frac {x}{2}\right )}{8 a}+\frac {\log \left (\cos \left (\frac {x}{2}\right )\right )}{2 a}-\frac {\log \left (\sin \left (\frac {x}{2}\right )\right )}{2 a}+\frac {\sec ^2\left (\frac {x}{2}\right )}{8 a}-\frac {\tan \left (\frac {x}{2}\right )}{2 a} \]

[In]

Integrate[Cot[x]^4/(a + a*Csc[x]),x]

[Out]

x/a + Cot[x/2]/(2*a) - Csc[x/2]^2/(8*a) + Log[Cos[x/2]]/(2*a) - Log[Sin[x/2]]/(2*a) + Sec[x/2]^2/(8*a) - Tan[x
/2]/(2*a)

Maple [A] (verified)

Time = 0.84 (sec) , antiderivative size = 51, normalized size of antiderivative = 1.65

method result size
default \(\frac {\frac {\tan \left (\frac {x}{2}\right )^{2}}{2}-2 \tan \left (\frac {x}{2}\right )+8 \arctan \left (\tan \left (\frac {x}{2}\right )\right )-\frac {1}{2 \tan \left (\frac {x}{2}\right )^{2}}+\frac {2}{\tan \left (\frac {x}{2}\right )}-2 \ln \left (\tan \left (\frac {x}{2}\right )\right )}{4 a}\) \(51\)
risch \(\frac {x}{a}+\frac {2 i {\mathrm e}^{2 i x}+{\mathrm e}^{3 i x}-2 i+{\mathrm e}^{i x}}{a \left ({\mathrm e}^{2 i x}-1\right )^{2}}-\frac {\ln \left ({\mathrm e}^{i x}-1\right )}{2 a}+\frac {\ln \left ({\mathrm e}^{i x}+1\right )}{2 a}\) \(67\)

[In]

int(cot(x)^4/(a+a*csc(x)),x,method=_RETURNVERBOSE)

[Out]

1/4/a*(1/2*tan(1/2*x)^2-2*tan(1/2*x)+8*arctan(tan(1/2*x))-1/2/tan(1/2*x)^2+2/tan(1/2*x)-2*ln(tan(1/2*x)))

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 64 vs. \(2 (25) = 50\).

Time = 0.26 (sec) , antiderivative size = 64, normalized size of antiderivative = 2.06 \[ \int \frac {\cot ^4(x)}{a+a \csc (x)} \, dx=\frac {4 \, x \cos \left (x\right )^{2} + {\left (\cos \left (x\right )^{2} - 1\right )} \log \left (\frac {1}{2} \, \cos \left (x\right ) + \frac {1}{2}\right ) - {\left (\cos \left (x\right )^{2} - 1\right )} \log \left (-\frac {1}{2} \, \cos \left (x\right ) + \frac {1}{2}\right ) - 4 \, \cos \left (x\right ) \sin \left (x\right ) - 4 \, x + 2 \, \cos \left (x\right )}{4 \, {\left (a \cos \left (x\right )^{2} - a\right )}} \]

[In]

integrate(cot(x)^4/(a+a*csc(x)),x, algorithm="fricas")

[Out]

1/4*(4*x*cos(x)^2 + (cos(x)^2 - 1)*log(1/2*cos(x) + 1/2) - (cos(x)^2 - 1)*log(-1/2*cos(x) + 1/2) - 4*cos(x)*si
n(x) - 4*x + 2*cos(x))/(a*cos(x)^2 - a)

Sympy [F]

\[ \int \frac {\cot ^4(x)}{a+a \csc (x)} \, dx=\frac {\int \frac {\cot ^{4}{\left (x \right )}}{\csc {\left (x \right )} + 1}\, dx}{a} \]

[In]

integrate(cot(x)**4/(a+a*csc(x)),x)

[Out]

Integral(cot(x)**4/(csc(x) + 1), x)/a

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 86 vs. \(2 (25) = 50\).

Time = 0.35 (sec) , antiderivative size = 86, normalized size of antiderivative = 2.77 \[ \int \frac {\cot ^4(x)}{a+a \csc (x)} \, dx=-\frac {\frac {4 \, \sin \left (x\right )}{\cos \left (x\right ) + 1} - \frac {\sin \left (x\right )^{2}}{{\left (\cos \left (x\right ) + 1\right )}^{2}}}{8 \, a} + \frac {2 \, \arctan \left (\frac {\sin \left (x\right )}{\cos \left (x\right ) + 1}\right )}{a} - \frac {\log \left (\frac {\sin \left (x\right )}{\cos \left (x\right ) + 1}\right )}{2 \, a} + \frac {{\left (\frac {4 \, \sin \left (x\right )}{\cos \left (x\right ) + 1} - 1\right )} {\left (\cos \left (x\right ) + 1\right )}^{2}}{8 \, a \sin \left (x\right )^{2}} \]

[In]

integrate(cot(x)^4/(a+a*csc(x)),x, algorithm="maxima")

[Out]

-1/8*(4*sin(x)/(cos(x) + 1) - sin(x)^2/(cos(x) + 1)^2)/a + 2*arctan(sin(x)/(cos(x) + 1))/a - 1/2*log(sin(x)/(c
os(x) + 1))/a + 1/8*(4*sin(x)/(cos(x) + 1) - 1)*(cos(x) + 1)^2/(a*sin(x)^2)

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 65 vs. \(2 (25) = 50\).

Time = 0.27 (sec) , antiderivative size = 65, normalized size of antiderivative = 2.10 \[ \int \frac {\cot ^4(x)}{a+a \csc (x)} \, dx=\frac {x}{a} - \frac {\log \left ({\left | \tan \left (\frac {1}{2} \, x\right ) \right |}\right )}{2 \, a} + \frac {a \tan \left (\frac {1}{2} \, x\right )^{2} - 4 \, a \tan \left (\frac {1}{2} \, x\right )}{8 \, a^{2}} + \frac {6 \, \tan \left (\frac {1}{2} \, x\right )^{2} + 4 \, \tan \left (\frac {1}{2} \, x\right ) - 1}{8 \, a \tan \left (\frac {1}{2} \, x\right )^{2}} \]

[In]

integrate(cot(x)^4/(a+a*csc(x)),x, algorithm="giac")

[Out]

x/a - 1/2*log(abs(tan(1/2*x)))/a + 1/8*(a*tan(1/2*x)^2 - 4*a*tan(1/2*x))/a^2 + 1/8*(6*tan(1/2*x)^2 + 4*tan(1/2
*x) - 1)/(a*tan(1/2*x)^2)

Mupad [B] (verification not implemented)

Time = 18.97 (sec) , antiderivative size = 85, normalized size of antiderivative = 2.74 \[ \int \frac {\cot ^4(x)}{a+a \csc (x)} \, dx=\frac {{\mathrm {tan}\left (\frac {x}{2}\right )}^2}{8\,a}-\frac {2\,\mathrm {atan}\left (\frac {4}{4\,\mathrm {tan}\left (\frac {x}{2}\right )+2}-\frac {2\,\mathrm {tan}\left (\frac {x}{2}\right )}{4\,\mathrm {tan}\left (\frac {x}{2}\right )+2}\right )}{a}-\frac {\mathrm {tan}\left (\frac {x}{2}\right )}{2\,a}-\frac {\ln \left (\mathrm {tan}\left (\frac {x}{2}\right )\right )}{2\,a}+\frac {2\,\mathrm {tan}\left (\frac {x}{2}\right )-\frac {1}{2}}{4\,a\,{\mathrm {tan}\left (\frac {x}{2}\right )}^2} \]

[In]

int(cot(x)^4/(a + a/sin(x)),x)

[Out]

tan(x/2)^2/(8*a) - (2*atan(4/(4*tan(x/2) + 2) - (2*tan(x/2))/(4*tan(x/2) + 2)))/a - tan(x/2)/(2*a) - log(tan(x
/2))/(2*a) + (2*tan(x/2) - 1/2)/(4*a*tan(x/2)^2)